#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;

const int N=1e6+5;
string a,b;
int an[N],bn[N],ans[N];
bool check;

void substract(){
    cin>>a>>b;
    if((a<b&&a.size()==b.size())||(a.size()<b.size())){
        swap(a,b);
        check=true;
    }
    for(int i=a.size();i>0;i--)an[i]=a[a.size()-i]-'0';
    for(int i=b.size();i>0;i--)bn[i]=b[b.size()-i]-'0';
    int maxn=max(a.size(),b.size());
    if(maxn==0){
        cout<<"0";
        return;
    }
    for(int i=1;i<=maxn;i++){
        if(an[i]<bn[i]){
            an[i+1]--;
            an[i]+=10;
        }
        ans[i]=an[i]-bn[i];
    }

    while(maxn>1&&ans[maxn]==0)maxn--;

    if(check)cout<<"-";

    for(int i=maxn;i>0;i--)cout<<ans[i];
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    substract();

    return 0;
}